package tmooc._0505;

import java.util.Random;
import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
       /*
        Scanner scan = new Scanner(System.in);
        Random rand = new Random();
        int a = rand.nextInt(1000)+1;
        int i = 0;
                while(true){
                    System.out.println(a);
                    int num  = scan.nextInt();

                    if (num != a) {
                        if (num > a ){
                            System.out.println("猜大了");
                        }else {
                            System.out.println("猜小了");
                        }
                    }else {
                        System.out.println("猜对了");
                        break;
                    }

                }*/



/*
        Scanner scan  = new Scanner(System.in);
        Random rand  = new Random();
        int a = rand.nextInt();
        int i = 0;
        while (true){
            System.out.println(a);
            int num = scan.nextInt();
            if (a != num){
                if(num >a){
                    System.out.println("猜大了");
                }else {
                    System.out.println("猜小了");
                }
            }else{
                System.out.println("猜对了");
                break;
            }


        }

*/

        Scanner scan  = new Scanner(System.in);
        Random rand  = new Random();
        int a = rand.nextInt(1001);
        int i = 0;
        while (true){
            System.out.println(a);
            int num = scan.nextInt();
            if (a != num){
                if(num >a){
                    System.out.println("猜大了");
                }else {
                    System.out.println("猜小了");
                }
            }else{
                System.out.println("猜对了");
                break;
            }


        }








    }
}
